package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	gorm.Model
	Img      string `gorm:"type:varchar(500)"json:"img"`
	Tel      string `gorm:"type:char(11)"json:"tel"`
	Password string `form:"type:char(32)"json:"password"`
	Username string `form:"type:varchar(30)"json:"username"`
}
type House struct {
	gorm.Model
	Title    string  `gorm:"type:varchar(30)"json:"title"`
	Lease    string  `gorm:"type:varchar(30)"json:"lease"`
	Money    float64 `gorm:"type:decimal(10,2)"json:"money"`
	Deposit  string  `gorm:"type:varchar(200)"json:"deposit"`
	Num      float64 `gorm:"type:decimal(10,2)"json:"num"`
	Facility string  `gorm:"type:varchar(30)"json:"facility"`
	UserId   int     `gorm:"type:int(11)"json:"userId"`
	Address  string  `gorm:"type:varchar(30)"json:"address"`
}
type Appointment struct {
	gorm.Model
	Time    time.Time
	UserId  int    `gorm:"int(11)"json:"userId"`
	HouseId int    `gorm:"int(11)"json:"houseId"`
	Name    string `gorm:"type:varchar(30)"json:"name"`
	Tel     string `gorm:"type:varchar(11)"json:"tel"`
	Status  string `gorm:"type:varchar(20)"json:"status"`
}

type Consultation struct {
	gorm.Model
	Content string `gorm:"type:varchar(30)"`
	UserId  int    `gorm:"type:int(11)"json:"userId"`
	HouseId int    `gorm:"type:int(11)"json:"houseId"`
}
type HouseName struct {
	House
	UserName string `gorm:"type:varchar(30)"`
}
type AppointmentUser struct {
	Appointment
	UserTel      string `gorm:"char(11)"json:"userTel"`
	HouseName    string `gorm:"type:varchar(30)"json:"houseName"`
	HouseAddress string `gorm:"type:varchar(30)"json:"houseName"`
}
